package cn.edu.sdjzu.xg23.kcsj01_backend.controller;


import cn.edu.sdjzu.xg23.kcsj01_backend.entity.Subject;
import cn.edu.sdjzu.xg23.kcsj01_backend.service.SubjectService;
import cn.edu.sdjzu.xg23.kcsj01_backend.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SubjectController {
    @Autowired
    private SubjectService subjectService;
    @GetMapping("/subject")
    public Result getAllSubject(){
        List<Subject> subjects = subjectService.getAllSubjects();
        return Result.success(subjects);
    }
}
